<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .box {
      background-color: #f00;
      height: 300px;
      /*适应于行内级（行内级: 行内非替换元素span/a 行内替换元素 img input inline-block）
      display: inline-block*/
      text-align: center;
    }

    .content {
      background-color: #0f0;
      height: 200px;
      width: 200px;

      /* display: inline-block; */
      margin: 0 auto;
    }
  </style>
</head>
<body>
  
  <div class="box">
    <div class="content"></div>
  </div>

</body>
</html>